<!-- 
    @author Wójcik Karol <wojcikk@student.agh.edu.pl>
    @licence http://www.gnu.org/copyleft/gpl.html GNU/GPL
-->

<div id="colOne">
    <%= render :partial => "menu" %>
</div>
<div id="colTwo">
<% if @lessons.blank? %>
    <h1>Aktualnie nie ma dost&#281;pnych zaj&#281;c</h1>
<% else %>

<h1>Zajecia</h1>

<table border='0'>
  <tr>
    <th><a href="/lessons/?sortby=subject">Przedmiot</a></th>
    <th><a href="/lessons/?sortby=class_type">Typ Zajec</a></th>
    <th><a href="/lessons/?sortby=lgodznazaj">LGodzNaZaj</a></th>
    <th><a href="/lessons/?sortby=lgrzaj">LGrZaj</a></th>
    <th><a href="/lessons/?sortby=lgrroz">LGrRoz</a></th>
    <th><a href="/lessons/?sortby=semestr">Semestr</a></th>
  </tr>
  
<% for lesson in @lessons %>
  <tr>
    <td><%=h lesson.subject.name %></td>
    <td><%=h lesson.class_type.name %></td>
    <td><%=h lesson.lgodznazaj %></td>
    <td><%=h lesson.lgrzaj %></td>
    <td><%=h lesson.lgrroz %></td>
    <td><%=h lesson.semestr %></td>
    
    <td><%= link_to 'Poka&#380;', :action => 'show', :id => lesson %></td>
    <td><%= link_to 'Zmie&#324;', :action => 'edit', :id => lesson %></td>
    <td><%= link_to 'Usu&#324;', { :action => 'destroy', :id => lesson }, :confirm => 'Are you sure?', :post => true %></td>
  </tr>
<% end %>
</table>


<br><br><br>
Click on head of column you want to sort
<br>

<br />
<% end %>
<%= link_to 'Utw&#243;rz nowy', :action => 'new' %>

</div>